package dbz.domain.player;

import dbz.domain.Deck;
import dbz.domain.deck.expceptions.EmptyDeckException;
import dbz.domain.hand.Hand;

public class Player {

	Hand hand;
	Deck deck;
	DiscardPile discardPile;
	
	public Player(Deck deck) {
		this.hand = new Hand();
		this.deck = deck;
		this.discardPile = new DiscardPile();
	}
	
	public void drawCards(Integer amount) throws EmptyDeckException {
		for (int i = 0; i < amount; i++) {
			drawCard();
		}
	}
	
	
	public void drawCard() throws EmptyDeckException {
		hand.addCard(deck.drawCard());
	}
	
	public Hand getHand() {
		return hand;
	}

	public void setHand(Hand hand) {
		this.hand = hand;
	}

	public void shuffleDeck() {
		deck.shuffle();
	}

	public Deck getDeck() {
		return deck;
	}

	public void setDeck(Deck deck) {
		this.deck = deck;
	}

	public DiscardPile getDiscardPile() {
		return discardPile;
	}

	public void setDiscardPile(DiscardPile discardPile) {
		this.discardPile = discardPile;
	}
	
}
